<?php if (!defined("_ECRIRE_INC_VERSION")) return; if (class_exists('InvoiceCreator')) return;
/**
 * Aloha Cart
 *
 * @author     Aleksey Yaroshchuk (aleksey.yaroshchuk@gmail.com)
 * @license    GNU/GPL
 * @package    plugins
 * @subpackage alohacart
 * @copyright  (c) Aleksey Yaroshchuk 2011-2012
 * @link       http://www.spip-contrib.net/AlohaCart
 */
 
 include_spip('functions/pdk_common');

 /** 
 *  This class is a base abstract class for all invoice creators
 *
 *  @author Aleksey Yaroshchuk (aleksey.yaroshchuk@gmail.com)
 */
abstract class InvoiceCreator {    
	/**
	 * AlohacartExtensionModel
	 */
	protected $extension_mdl;
	
	/**
	 * AlohacartExtension
	 */
	protected $extension;
	
	/**
	 * AlohacartOrderModel
	 */
	protected $order_mdl;
    
    /**
	 * AlohacartOrderProductModel
	 */
	protected $order_product_mdl;
    
    /**
	 * CurrencyModel
	 */
	protected $currency_mdl;
    
    /**
	 * VatCalculator
	 */
	protected $vat_calculator;
	
	public function __construct() {
		$this->extension_mdl = pdk_load_class('AlohacartExtensionModel', 'classes'); 
		$this->extension = $this->extension_mdl->GetExtensionClassByCode('invoice');
		$this->order_mdl = pdk_load_class('AlohacartOrderModel', 'classes');
        $this->order_product_mdl = pdk_load_class('AlohacartOrderProductModel', 'classes');
        $this->currency_mdl = pdk_load_class('CurrencyModel', 'classes');
        $this->vat_calculator = pdk_load_class('VatCalculator', 'classes/payment/invoice/');
	}
    
	/**
	 *  Creates invoice number
	 */
	protected function CreateInvoiceNumber() {
		return date('Ymd-His');
	}
	
	/**
	 *  Creates invoice date
	 */
	protected function CreateInvoiceDate() {
		return date('d.m.Y');
	}
}
?>